<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
import { mapActions } from 'vuex';

export default {
  created() {
    if (this.$auth.loggedIn()) {
      this.getUserInfo();
      // 定期刷新用户信息
      setInterval(() => {
        this.getUserInfo();
      }, 10 * 60 * 1000);
    }
  },

  methods: {
    ...mapActions({
      getUserInfo: 'getUserInfo'
    }),
  }
};
</script>

<style>
  body {
    zoom: 1.1
  }

  #app {
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
  }
</style>
